﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site1.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">

 <body  onload='init()' onunload="GUnload()" onKeyDown="return keyDown(event);" onKeyUp="return keyUp(event);">
<center>
 
 
  <div id='map3d' style="border: 1px solid #000; height: 500px;"></div>
 
  <table >
    <tr>
      <td>
	
 
	<div>
	  <form name='searchform' id='searchform' action='javascript:submitLocation();void(0);'>
	    <input type=text size=60 id='address' value='(Ingrese una direccion, por favor)'></input>
	    <input type=submit value='Teleport!'>
	  </form>
 
	  Presets:
      <input type=button value="ini" onload='init()' onunload="GUnload()" onKeyDown="return keyDown(event);" onKeyUp="return keyUp(event);"/>
	  <input type=button value="Lima" onclick="doGeocode('Lima,Peru');">
	  <input type=button value="Quito" onclick="doGeocode('Quito,Ecuador');">
	  <input type=button value="Guayaquil" onclick="doGeocode('Guayaquil,Ecuador');">
	  <input type=button value="Buenos Aires" onclick="doGeocode('Buenos Aires,Argentina');">
	  <input type=button value="Santiago" onclick="doGeocode('Santiago,Chile');">
	  <input type=button value="Rio de Janeiro" onclick="doGeocode('Rio de Janeiro,Brasil');">
	</div>
 
 
      </td>
      <td>
        <table>
	  <tr>
	    <td></td>
	    <td><input type=button class="button medw" onmousedown="gasButtonDown=true;" onmouseup="gasButtonDown = false;" value="acelera"></td>
	    <td></td>
	  </tr>
	  <tr>
	    <td><input type=button class="button medw" onmousedown="leftButtonDown=true;" onmouseup="leftButtonDown=false;" value="<-"></td>
	    <td></td>
	    <td><input type=button class="button medw" onmousedown="rightButtonDown=true;" onmouseup="rightButtonDown=false;" value="->"></td>
	  </tr>
	  <tr>
	    <td></td>
	    <td><input type=button class="button medw" onmousedown="reverseButtonDown=true;" onmouseup="reverseButtonDown=false;" value="freno"></td>
	    <td></td>
	  </tr>
	</table>
      </td>
    </tr>
  </table>
</center>
</body>


</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContentPlaceHolder" runat="server">


 <title>Navegador ZEUS 3D!</title>
 
  <link href="<%= ResolveUrl("~") %>Content/milktruck.css" rel="stylesheet" type="text/css" />
  <!-- *** Replace the key below below with your own API key, available at http://code.google.com/apis/maps/signup.html *** -->
  <script src="http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw"></script>
  <script type="text/javascript" src="<%= ResolveUrl("~") %>Scripts/math3d.js"></script>
  <script type="text/javascript" src="<%= ResolveUrl("~") %>Scripts/keyboard-focus-hack.js"></script>
  <script type="text/javascript" src="<%= ResolveUrl("~") %>Scripts/kmldomwalk.js"></script>
  <script type="text/javascript" src="<%= ResolveUrl("~") %>Scripts/milktruck.js"></script>
  <script type="text/javascript">

     google.load("earth", "1");
    google.load("maps", "2");

      var ge = null;
      var geocoder;
      var truck;

      function el(e) { return document.getElementById(e); }

      function Sample(description, url) {
          this.description = description;
          this.url = url;
          return this;
      }

      var samples = [];

      function init() {
          geocoder = new GClientGeocoder();

          init3D();
      }

      function initCallback(object) {
          ge = object;
          ge.getWindow().setVisibility(true);
          ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);
          ge.getOptions().setFlyToSpeed(ge.SPEED_TELEPORT);

          truck = new Truck();

          keyboardFocusHack(ge);
      }

      function failureCallback(err) {
          /***
          * This function will be called if plugin fails to load, in case
          * you need to handle that error condition.
          ***/
      }

      function init3D() {
          google.earth.createInstance("map3d", initCallback, failureCallback);
      }

      function submitLocation() {
          doGeocode(el('address').value);
      }

      function doGeocode(address) {
          geocoder.getLatLng(address, function (point) {
              if (point) {
                  if (ge != null && truck != null) {
                      truck.teleportTo(point.y, point.x);
                  }
              }
          });
      }
 
  </script>



</asp:Content>

